package com.hospital.wx.controller.form;

import com.hospital.wx.util.annotation.NoSensitiveWords;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Schema(description = "添加评论的表单")
public class AddCommentForm {
    @NotNull(message = "文章ID不能为空")
    @Schema(description = "文章ID", required = true, example = "1")
    private Integer postId;

    @NotNull(message = "用户ID不能为空")
    @Schema(description = "当前登录用户ID，未登录不可评论", example = "10001")
    private Integer userId;

    @NotBlank(message = "不能发送空的评论")
    @Schema(description = "评论内容不能为空")
    @NoSensitiveWords(message = "评论内容包含敏感词，请修改后再提交")
    private String content;
}
